package com.vegetable.modules.service.inbound.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vegetable.modules.entity.inbound.PackDeliveryDetail;
import com.vegetable.modules.mapper.inbound.PackDeliveryDetailMapper;
import com.vegetable.modules.service.inbound.IPackDeliveryDetailService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 加工打包完工成品 服务实现类
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-21
 */
@Slf4j
@Service
@AllArgsConstructor
public class PackDeliveryDetailServiceImpl extends ServiceImpl<PackDeliveryDetailMapper, PackDeliveryDetail> implements IPackDeliveryDetailService {

    @Override
    public List<PackDeliveryDetail> selectByOrderId(Long orderId) {
        List<PackDeliveryDetail> details = baseMapper.selectByOrderId(orderId);
        return details;
    }

    @Override
    public List<PackDeliveryDetail> selectByStockId(Long stockId) {
        QueryWrapper<PackDeliveryDetail> wrapper = new QueryWrapper<>();
        wrapper.eq("stock_id", stockId);
        List<PackDeliveryDetail> details = baseMapper.selectList(wrapper);
        return details;
    }
}
